package UI;


import java.awt.Color;

import javax.swing.JFrame;
import javax.swing.JPanel;

import DBTasks.DBTask;


@SuppressWarnings("serial")
public class MainFrame extends JFrame{

	private LoginPanel login;
	private SearchPanel search;
	private ShelterResultsPanel shelter;
	private PetResultsPanel pet;
	private HomepagePanel homepage;
	private AddPetPanel addPet;
	private EventsPanel events;
	private FosterPanel foster;
	private DonationsPanel donations;
	private DailyPanel daily;
	private QuarterlyPanel quarterly;
	private YearlyPanel yearly;

	public MainFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBackground(Color.white);
        
		login = new LoginPanel(this);
		search = new SearchPanel(this);
        homepage = new HomepagePanel(this);
		
        setBounds(300, 10, login.getPreferredSize().width, login.getPreferredSize().height);
        
        setContentPane(login);
	}
	
	public void setPanel(JPanel panel) {
		setBounds(300, 10, panel.getPreferredSize().width, panel.getPreferredSize().height);
        
        setContentPane(panel);
	}
	
	public void setEmployeePanels() {
		addPet = new AddPetPanel(this);
		events = new EventsPanel(this);
	    foster = new FosterPanel(this);
	    donations = new DonationsPanel(this);
	    daily = new DailyPanel(this);
	    quarterly = new QuarterlyPanel(this);
	    yearly = new YearlyPanel(this);
	}
	
	public String getMonth(int monthInput) {
		if(monthInput == 0) {
			return "January";
		}
		else if(monthInput == 1) {
			return "February";
		}
		else if(monthInput == 2) {
			return "March";
		}
		else if(monthInput == 3) {
			return "April";
		}
		else if(monthInput == 4) {
			return "May";
		}
		else if(monthInput == 5) {
			return "June";
		}
		else if(monthInput == 6) {
			return "July";
		}
		else if(monthInput == 7) {
			return "August";
		}
		else if(monthInput == 8) {
			return "September";
		}
		else if(monthInput == 9) {
			return "October";
		}
		else if(monthInput == 10) {
			return "November";
		}
		else {
			return "December";
		}
	}
	
	public static void main(String[] args) {
        
		DBTask.connectToDatabase();
		
		MainFrame frame = new MainFrame();
		frame.setVisible(true);
		
    }

	public LoginPanel getLogin() {
		return login;
	}

	public void setLogin(LoginPanel login) {
		this.login = login;
	}

	public SearchPanel getSearch() {
		return search;
	}

	public void setSearch(SearchPanel search) {
		this.search = search;
	}

	public ShelterResultsPanel getShelter() {
		return shelter;
	}

	public void setShelter(ShelterResultsPanel shelter) {
		this.shelter = shelter;
	}

	public PetResultsPanel getPet() {
		return pet;
	}

	public void setPet(PetResultsPanel pet) {
		this.pet = pet;
	}

	public HomepagePanel getHomepage() {
		return homepage;
	}

	public void setHomepage(HomepagePanel homepage) {
		this.homepage = homepage;
	}

	public AddPetPanel getAddPet() {
		return addPet;
	}

	public void setAddPet(AddPetPanel addPet) {
		this.addPet = addPet;
	}

	public EventsPanel getEvents() {
		return events;
	}

	public void setEvents(EventsPanel events) {
		this.events = events;
	}

	public FosterPanel getFoster() {
		return foster;
	}

	public void setFoster(FosterPanel foster) {
		this.foster = foster;
	}

	public DonationsPanel getDonations() {
		return donations;
	}

	public void setDonations(DonationsPanel donations) {
		this.donations = donations;
	}

	public DailyPanel getDaily() {
		return daily;
	}

	public void setDaily(DailyPanel daily) {
		this.daily = daily;
	}

	public QuarterlyPanel getQuarterly() {
		return quarterly;
	}

	public void setQuarterly(QuarterlyPanel quarterly) {
		this.quarterly = quarterly;
	}

	public YearlyPanel getYearly() {
		return yearly;
	}

	public void setYearly(YearlyPanel yearly) {
		this.yearly = yearly;
	}

}
